package com.cn.test.ui.example;

import android.os.Bundle;
import android.view.View;

import com.cn.test.R;
import com.cn.test.base.BaseActivity;
import com.cn.test.model.response.UserInfoBean;
import com.cn.test.mvp.presenter.LoginUserPresenter;
import com.cn.test.mvp.presenter.view.LoginUserView;

import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2017/7/3.
 * do what to 2017/7/3
 */

public class EmptyActivity extends BaseActivity<LoginUserView, LoginUserPresenter> implements LoginUserView {

    @Override
    protected int getNormalLayoutId() {
        return R.layout.activity_update_info;
    }

    @Override
    protected int getErrorLayoutId() {
        return R.layout.activity_update_info;
    }

    @Override
    protected LoginUserPresenter createPresenter() {
        return new LoginUserPresenter(this, this);
    }

    @Override
    protected void initViewsAndEvents() {
    }


//    /**
//     * @param
//     */
//    private void login(String account, String password) {
////        DialogHelper
//        Map<String, String> params = new HashMap<>();
//        params.put("account", account);          // 账号登陆的时候需要MD5加密，服务器需求
//        params.put("password", password);// 账号登陆的时候需要MD5加密，服务器需求
//        HttpUtils.post().url(AppConfig.USER_LOGIN)
//                .params(params)
//                .build()
//                .execute(new BaseCallback<LoginRegisterResult>(LoginRegisterResult.class) {
//                    @Override
//                    public void onResponse(ObjectResult<LoginRegisterResult> result) {
////                        DialogHelper.dismissProgressDialog();
//                        Log.d("Debug", "到达请求这里---");
//                        if (Result.checkSuccess(EmptyActivity.this, result)) {
//                            ToastUtil.showShort("登陆成功");
//                            LoginRegisterResult data = result.getData();
//                            PrefShare.getInstance(EmptyActivity.this).saveString("token", data.getUserinfo().getToken());
//                            PrefShare.getInstance(EmptyActivity.this).saveString("userId", data.getUserinfo().getId() + "");
//                            startActivity(new Intent(EmptyActivity.this, MainActivity.class));
//                        }
//                    }
//
//                    @Override
//                    public void onError(Call call, Exception e) {
////                        DialogHelper.dismissProgressDialog();
////                        ToastUtil.showErrorNet(LoginActivity.this);
//                    }
//                });
//    }


    @OnClick({R.id.setting_back})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.setting_back:
                finish();
                break;
        }
    }

    @Override
    public void onLogin(UserInfoBean resultBean) {

    }

    @Override
    public void requestFailed(String message) {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

}
